R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

chicago_map <- read_sf("ward_boundaries.geojson")
ggplot(data = chicago_map) + geom_sf()

hbh_data <- read.csv("hbh_locations.csv")
hbh_df <- data.frame(hbh_data)
hbh_df$Lat <- as.numeric(hbh_df$Lat)
hbh_df$Long <- as.numeric(hbh_df$Long)
hbh_df$Site <- as.character(hbh_df$Site)

Including Plots

You can also embed plots, for example:

ggplot() +
  geom_sf(data = chicago_map, fill = "ivory", colour = "ivory") + 
  geom_point (data = hbh_df, aes(x = Long, y = Lat))

hbh_df <- hbh_df %>% mutate(desc = paste(`Site`, sep = "\n"))

site_info <- ggplot() +
  geom_sf(data = chicago_map, fill = "ivory", colour = "ivory") + 
  geom_point (data = hbh_df, aes(x = Long, y = Lat, text = desc))
## Warning: Ignoring unknown aesthetics: text
ggplotly(site_info, tooltip = "desc")